Skip to content

feat(speculation): add prioritizer + prioritization-limit extensions#320

Draft
behinddwalls wants to merge 1 commit into
preetam/ext/speculation-selectorfrom
preetam/ext/speculation-prioritizer
Draft

feat(speculation): add prioritizer + prioritization-limit extensions#320
behinddwalls wants to merge 1 commit into
preetam/ext/speculation-selectorfrom
preetam/ext/speculation-prioritizer

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add the prioritizer seam and its limit counterpart from the speculation RFC, as vendor-agnostic extension interfaces under submitqueue/extension/speculation/.

prioritizer: the queue-wide policy that rations a shared build budget across every in-flight batch. The controller hands it the queue's candidate paths — every path that is Selected (wants a slot) or Prioritized/Building (holds a slot), each with its score — and it returns sparse decisions: Promote to admit a pending path, Cancel to preempt a running one; omitted paths are left as-is. Whether it preempts is its own per-queue policy (sticky-slots vs preemptive), so the interface is unchanged either way. It never writes; the controller maps each decision to a guarded status transition (Promote → Prioritized, Cancel → Cancelling) and enacts it, staying the single writer. It shares the selector's SpeculationPathDecision output and ranks on the scorer's path Score, so it lives in the same speculation/ family.

prioritizationlimit: the "how much" policy bounding how many builds the queue runs at once — the queue's concurrent-build budget and the ultimate cap on speculation's demand on CI. Injected into the prioritizer at construction and called by it; the value is dynamic, not a fixed constant.

Each follows the repo extension contract: Factory.For(Config) (T, error) with Config carrying only QueueName. Includes READMEs, gomock packages, and programmable fakes. Interfaces only; concrete impls and controller wiring are deferred.

Test Plan

Issues

Stack

  1. feat(entity,storage): rework speculation tree model and store #231
  2. feat(speculation): add enumerator + dependency-limit extensions #315
  3. feat(speculation): add path scorer extension #316
  4. feat(speculation): add selector + selection-limit extensions #317
  5. @ feat(speculation): add prioritizer + prioritization-limit extensions #320

Add the prioritizer seam and its limit counterpart from the speculation RFC, as vendor-agnostic extension interfaces under submitqueue/extension/speculation/.

prioritizer: the queue-wide policy that rations a shared build budget across every in-flight batch. The controller hands it the queue's candidate paths — every path that is Selected (wants a slot) or Prioritized/Building (holds a slot), each with its score — and it returns sparse decisions: Promote to admit a pending path, Cancel to preempt a running one; omitted paths are left as-is. Whether it preempts is its own per-queue policy (sticky-slots vs preemptive), so the interface is unchanged either way. It never writes; the controller maps each decision to a guarded status transition (Promote → Prioritized, Cancel → Cancelling) and enacts it, staying the single writer. It shares the selector's SpeculationPathDecision output and ranks on the scorer's path Score, so it lives in the same speculation/ family.

prioritizationlimit: the "how much" policy bounding how many builds the queue runs at once — the queue's concurrent-build budget and the ultimate cap on speculation's demand on CI. Injected into the prioritizer at construction and called by it; the value is dynamic, not a fixed constant.

Each follows the repo extension contract: Factory.For(Config) (T, error) with Config carrying only QueueName. Includes READMEs, gomock packages, and programmable fakes. Interfaces only; concrete impls and controller wiring are deferred.
@behinddwalls behinddwalls force-pushed the preetam/ext/speculation-selector branch from d9084c2 to 0ae2849 Compare July 9, 2026 17:42
@behinddwalls behinddwalls force-pushed the preetam/ext/speculation-prioritizer branch from ade23bb to 2516cc1 Compare July 9, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant